package com.sasis.service.mock;

import java.util.Collection;
import java.util.LinkedList;

import com.sasis.model.Function;
import com.sasis.model.HandleType;
import com.sasis.service.FunctionService;

public class FunctionServiceMock implements FunctionService {

	public Collection getFunctionsTree() {
		Function function1 = new Function();
		function1.setId(new Long(1));
		function1.setName("aaaaa");
		function1.setParentId(new Long(0));
		
		Function function2 = new Function();
		function2.setId(new Long(2));
		function2.setName("bbbbbb");
		function2.setParentId(function1.getId());
		
		Function function3 = new Function();
		function3.setId(new Long(3));
		function3.setName("cccccc");
		function3.setParentId(function2.getId());
		
		Collection functions3 = new LinkedList();
		functions3.add(function3);
		function2.setChilds(functions3);
		
		Collection functions2 = new LinkedList();
		functions2.add(function2);
		function1.setChilds(functions2);
		
		Collection functions1 = new LinkedList();
		functions1.add(function1);
		return functions1;
	}

	public Collection getHandleTypes() {
		Collection handleTypes = new LinkedList();
		HandleType handleType = new HandleType();
		handleType.setId(new Long(1));
		handleType.setName("add");
		handleType.setSort(1);
		handleTypes.add(handleType);
		return handleTypes;
	}

	public Collection getHandlesTree() {
		return getFunctionsTree();
	}

	public Collection getFunctionsTreeByUser(Long userId) {
		// TODO Auto-generated method stub
		return null;
	}

	public Function loadByUrl(String url) {
		// TODO Auto-generated method stub
		return null;
	}

}
